﻿package mortal.component.skin.button
{
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.skins.*;
    import fl.core.*;
    import flash.geom.*;
    import mortal.common.*;
    import mortal.common.font.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;

    public class ChatButtonStyle extends SkinStyle
    {
        private var _scaleRect:Rectangle;
        private var _textFormat:GTextFormat;
        private var _textFormatDisable:GTextFormat;

        public function ChatButtonStyle()
        {
            this._scaleRect = new Rectangle(9, 9, 1, 1);
            this._textFormat = GlobalStyle.textFormatPutong.setFont(FontUtil.defaultName);
            this._textFormatDisable = GlobalStyle.textFormatJiang.setFont(FontUtil.defaultName);
            return;
        }// end function

        override public function setStyle(param1:UIComponent) : void
        {
            param1.setStyle("upSkin", GlobalClass.getScaleBitmap(ImagesConst.chatBtn_upSkin, this._scaleRect));
            param1.setStyle("downSkin", GlobalClass.getScaleBitmap(ImagesConst.chatBtn_upSkin, this._scaleRect));
            param1.setStyle("overSkin", GlobalClass.getScaleBitmap(ImagesConst.chatBtn_overSkin, this._scaleRect));
            param1.setStyle("disabledSkin", GlobalClass.getScaleBitmap(ImagesConst.chatBtn_upSkin, this._scaleRect));
            param1.setStyle("textPadding", 0);
            param1.setStyle("textFormat", this._textFormat);
            param1.setStyle("disabledTextFormat", this._textFormatDisable);
            (param1 as GButton).textField.height = 20;
            return;
        }// end function

    }
}
